<template>
  <el-dropdown>
    <user-avatar/>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item @click="toUserCenter">个人主页</el-dropdown-item>
<!--        <el-dropdown-item>我的消息</el-dropdown-item>-->
        <el-dropdown-item @click="logout">退出登录</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</template>
<script setup>
import UserAvatar from "@/views/component/UserAvatar.vue";
import router from "@/router/index.js";
import {useUserStore} from "@/store/index.js";

const userStore = useUserStore();

const toUserCenter = () => {
  router.push('/userCenter');
}

const logout = () => {
  userStore.setUserLogout()
}
</script>
